import React, { useRef } from 'react';
import SearchTree from './components/SearchTree';
import { Button } from 'antd';

function HomePage() {
  const ref = useRef(null);
  function handleGetTreeData() {
    const treeData = ref.current.getTreeData();
    console.log(treeData);
  }
  return (
    <div>
      <Button onClick={handleGetTreeData}>获取树</Button>
      <SearchTree onTreeDataChange={(data) => console.log(data)} ref={ref} />
    </div>
  );
}

export default HomePage;
